package com.exception;

import com.util.JsonResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

//统一的父类
public class CommExceptionAdvice {
    @ExceptionHandler(BusinessException.class)
    @ResponseBody
    public JsonResult handler(BusinessException e){
        e.printStackTrace();
        return new JsonResult(e.getCodeMsg().getCode(), e.getCodeMsg().getMsg(), null);
    }
}